<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户登录</title>
    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        /* 自定义样式 */
        body {
            background-color: #f8f9fa;
        }

        .login-container {
            max-width: 400px;
            margin: 80px auto;
            padding: 30px;
            background-color: #ffffff;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }

        .login-title {
            margin-bottom: 20px;
            text-align: center;
            color: #343a40;
        }

        .error-message {
            color: #dc3545;
            margin-top: 15px;
            text-align: center;
        }

        .link-group {
            margin-top: 20px;
        }

        .link-group .btn {
            width: 100%;
            margin-bottom: 10px;
            transition: background-color 0.3s, color 0.3s;
        }

        .link-group .btn:hover {
            background-color: #007bff;
            color: #ffffff;
        }

        /* 在每行两个按钮 */
        @media (min-width: 576px) {
            .link-group .col-sm-6 .btn {
                margin-bottom: 0;
            }
        }
    </style>
</head>
<body>
<div class="login-container">
    <h2 class="login-title">用户登录</h2>
    <form action="/login" method="post">
        <div class="mb-3">
            <label for="username" class="form-label">用户名</label>
            <input type="text" class="form-control" id="username" name="username" placeholder="请输入用户名" required>
        </div>
        <div class="mb-3">
            <label for="password" class="form-label">密码</label>
            <input type="password" class="form-control" id="password" name="password" placeholder="请输入密码" required>
        </div>
        <button type="submit" class="btn btn-primary w-100">登录</button>
    </form>

    <!-- 显示错误信息 -->
    <c:if test="${not empty error}">
        <p class="error-message">${error}</p>
    </c:if>

    <!-- 优化后的链接组 -->
    <div class="link-group">
        <div class="row g-2">
            <div class="col-12 col-sm-6">
                <a href="teammember-register.jsp" class="btn btn-outline-primary">账号注册</a>
            </div>
            <div class="col-12 col-sm-6">
                <a href="applicationCheck.jsp" class="btn btn-outline-primary">查看申请状态</a>
            </div>
            <div class="col-12 col-sm-6">
                <a href="retrievePassword.jsp" class="btn btn-outline-primary">找回密码</a>
            </div>
            <div class="col-12 col-sm-6">
                <a href="/dashboard" class="btn btn-outline-primary">返回首页</a>
            </div>
        </div>
    </div>
</div>

<!-- Bootstrap JS 和依赖 -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
